using Business.AreaManagement;
using Business.AreaManagement.Dto;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/Area")]
    public class AreaController : AbpController
    {
        private readonly IAreaAppService _AreaAppService;

        public AreaController(IAreaAppService AreaAppService)
        {
            _AreaAppService = AreaAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<AreaDto> DataPost(CreateOrUpdateAreaDto input)
        {
            return _AreaAppService.DataPost(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _AreaAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<AreaDto> Get(Guid id)
        {
            return _AreaAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<AreaDto>> GetAll(GetAreaInputDto input)
        {
            return _AreaAppService.GetAll(input);
        }
    }
}
